// lib/toast-helper.ts
import { ToastActionElement } from '@/components/ui/toast'
import { create } from 'zustand'

type ToastData = {
  title: string
  description?: string
  variant?: 'default' | 'destructive'
  action?: ToastActionElement
}

interface ToastStore {
  data: ToastData | null
  show: (data: ToastData) => void
  hide: () => void
}

export const useToastStore = create<ToastStore>((set) => ({
  data: null,
  show: (data) => set({ data }),
  hide: () => set({ data: null }),
}))
